package com.slj.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class BaseEntity  {
    @Schema(description = "创建时间")
    @TableField(value = "created_at",fill=FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime createAt;
    @Schema(description = "更新时间")
    @TableField(value = "updated_at",fill=FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime updateAt;
    @Schema(description = "删除时间")
    @TableField("deleted_At")
    private LocalDateTime deleteAt;
    @Schema(description = "创建人")
    @TableField("created_By")
    private LocalDateTime createBy;
    @Schema(description = "更新人")
    @TableField("updated_By")
    private LocalDateTime updateBy;
    @Schema(description = "版本号")
    @Version
    @TableField(value = "version",fill = FieldFill.INSERT)
    private Integer version;
}
